﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Q.Framework.Utility;

namespace Q.Framework.WebCode
{
    public class BaseUserControl : System.Web.UI.UserControl
    {
        public virtual void MessageBox(String Message)
        {

            JavaScriptAdd.RegisterStartupScript(this.Page, "Message", new StringBuilder(String.Format("<script>alert('{0}');</script>", Message)));
            //WebCode.MessageBox.Show(Message, WebCode.MessageBox.MessageType.Info);
        }

        public virtual void MessageBoxAndRedirect(String Message, String Url)
        {
            JavaScriptAdd.RegisterStartupScript(this.Page, "Message", new StringBuilder(String.Format("<script>alert('{0}'); window.location.href = '{1}';</script>", Message, Url)));
            //WebCode.MessageBox.Show(Message, WebCode.MessageBox.MessageType.Info, Url);
        }
    }
}
